<?php
$str = '后盾网 houdunwang.com 后盾人 houdunren.com';
$pattern = '/(houdunwang|houdunren)(\.com)/';
$replace = '<a style="color: red" href="http://www.\1\2">www.\0</a>';
$newStr = preg_replace($pattern,$replace,$str);
echo $newStr;
